﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "resizeimagedialog.h"
#include "rotateimagedialog.h"
#include <QLabel>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

signals:
    //发送旧的宽度高度给子对话框
    void SendOldSize(int nOldWidth, int nOldHeight);

private slots:
    void on_pushButtonOpenImage_clicked();

    void on_pushButtonResizeImage_clicked();

    void on_pushButtonRotateImage_clicked();

    //收到新尺寸后进行缩放
    void RecvNewSizeAndResize(int nNewWidth, int nNewHeight);

private:
    Ui::MainWindow *ui;

    //图片显示的标签
    QLabel *m_pLabelImage;
    //图片操作类
    QPixmap m_image;
    //图片文件名
    QString m_strFileName;
    //缩放尺寸对话框
    ResizeImageDialog *m_pResizeDlg;
    //旋转图片对话框
    RotateImageDialog *m_pRotateDlg;
    //初始化函数
    void Init();
};
#endif // MAINWINDOW_H
